echo off

rem !!!!!!! If a level is specified, delete all the trigger/tmp files
if not "%1" == "" del %TEMP%\PIPN*.tmp

rem !!!!!!! If a level is specified, goto the appropriate level
if "%1" == "1" goto LEVEL1
if "%1" == "2" goto LEVEL2
if "%1" == "3" goto LEVEL3
if "%1" == "4" goto LEVEL4

if EXIST %TEMP%\PIPN1.tmp goto LEVEL2
rem !!!!!!!!!!!!!!!! BEGIN 1st Level
:LEVEL1
echo "***** Executing Level 1 *****"

start /wait ..\..\setup\hpzscr01.exe -datfile hpfscr05.dat -unattended -showdisconnect -nocopytotemp -d MsiUninstaller,TaskUninstaller,RemoveProgramUninstaller,ScannerUninstaller,AiONetworkDriveUninstaller,PrinterUninstaller,DriverUninstaller,ServiceUninstaller,PortUninstaller,RsmUninstaller,RegistryUninstaller,FileUninstaller,MonitorUninstaller,ProcessShutdown,WindowShutdown

copy uninstall.bat %TEMP%\PIPN1.tmp
goto EXIT
rem !!!!!!!!!!!!!!!! END 1st Level


rem !!!!!!!!!!!!!!!! BEGIN 2nd Level
:LEVEL2
if EXIST %TEMP%\PIPN2.tmp goto LEVEL3
echo "***** Executing Level 2 *****"
start /wait ..\..\setup\hpzscr01.exe -datfile hpfscr05.dat -unattended -showdisconnect -nocopytotemp

copy uninstall.bat %TEMP%\PIPN2.tmp
goto EXIT
rem !!!!!!!!!!!!!!!! END 2nd Level


rem !!!!!!!!!!!!!!!! BEGIN 3rd Level
:LEVEL3
if EXIST %TEMP%\PIPN3.tmp goto LEVEL4
echo "***** Executing Level 3 *****"
start /wait ..\..\setup\hpzscr01.exe -datfile hpfscr05.dat -unattended -showdisconnect -nocopytotemp -noreboot

start /wait ..\..\setup\hpzscr01.exe -datfile hpqscr01.dat -unattended -nocopytotemp

copy uninstall.bat %TEMP%\PIPN3.tmp
goto EXIT
rem !!!!!!!!!!!!!!!! END 3rd Level

	
rem !!!!!!!!!!!!!!!! BEGIN 4th Level
:LEVEL4
echo "***** Executing Level 4 *****"

REM IMAGE ZONE 5.3	
start /wait ..\..\setup\hpzscr01.exe -datfile hpqscr01.dat -unattended -nocopytotemp -noreboot

REM UNINSTALL Imaging Device Function
start /wait ..\..\setup\hpzscr01.exe -datfile hpqbud01.dat -unattended -nocopytotemp -noreboot

REM UNINSTALL Solution Center & Imaging Support Tool
start /wait ..\..\setup\hpzscr01.exe -datfile hpqbud05.dat -unattended -nocopytotemp -noreboot

REM UNINSTALL Customer Experience
start /wait ..\..\setup\hpzscr01.exe -datfile hpqbud06.dat -unattended -nocopytotemp -noreboot
	
REM UNINSTALL Extended Capabilities
start /wait ..\..\setup\hpzscr01.exe -datfile hpqhsc01.dat -unattended -nocopytotemp -noreboot

REM UNINSTALL DESKJET 5X00 SERIES		
start /wait ..\..\setup\hpzscr01.exe -datfile %SCRUBBER_DAT_FILE% -unattended -showdisconnect -nocopytotemp -forcereboot


rem !!!!!!!!!!!!!!!! END 4th Level

:EXIT